import { getUserDetailById } from '@/api/user'
import { saveUserDetailById } from '@/api/employees.js'
export default {
  data() {
    return {
      userInfo: {
        username: '',
        password: ''
      }
    }
  },
  methods: {
    async loadUserDetailById() {
      const res = await getUserDetailById(this.$route.params.id)
      console.log(res, 325)
      this.userInfo = res.data
    },
    async updata() {
      try {
        await saveUserDetailById(this.userInfo)
        this.$router.push('/employees')
      } catch (error) {
        this.$message.error('更新失败')
      }
    }
  }
}
